package com.luckku.boot.config;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * @author somebody
 * @date someday
 */

@Configuration
public class MyDataSourceConfig {

    @ConfigurationProperties("spring.datasource")/**与yml配置文件中的配置项绑定**/
    @Bean
    public DataSource dataSource(){

        return new DruidDataSource();
    }



}
